cmake_minimum_required(VERSION 2.6)
project(Shared)

include_directories(
    ${PROJECT_SOURCE_DIR}
)

set(SharedSRC
    Typedef.h
    Common.h
    Common.cc
    Util.h
    Util.cc
    WorldPacket.h
    PacketHeader.h
    
    ProgressBar.h
    ProgressBar.cc
)

set(Shared_Game_SRC
    Game/Opcodes.h
)

set(Shared_Log_SRC
    Log/Log.h
    Log/Log.cc
)

set(Shared_Auth_SRC
    Auth/AuthCode.h
    Auth/AuthPacket.h
    Auth/AuthCrypt.h
    Auth/AuthCrypt.cc
)

set(Shared_DBC_SRC
    DBC/DBCLoader.h
    DBC/DBCLoader.cc
    DBC/DBCStore.h
    DBC/DBCFileLoader.h
    DBC/DBCFileLoader.cc
)

set(Shared_Storage_SRC
    Storage/SQLStorage.h
    Storage/SQLStorage.cc
    Storage/SQLStorageImpl.h
)

add_library(Shared STATIC 
    ${SharedSRC} 
    ${Shared_Game_SRC} 
    ${Shared_Log_SRC} 
    ${Shared_Auth_SRC} 
    ${Shared_DBC_SRC}
    ${Shared_Storage_SRC}
)

if (MSVC)
    source_group("Game" FILES ${Shared_Game_SRC})
    source_group("Log" FILES ${Shared_Log_SRC})
    source_group("Auth" FILES ${Shared_Auth_SRC})
    source_group("DBC" FILES ${Shared_DBC_SRC})
    source_group("Storage" FILES ${Shared_Storage_SRC})
endif()